<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Used to retrieve a list of supported SVG versions</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairosvgsurface.construct.html">CairoSvgSurface::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairosvgsurface.restricttoversion.html">CairoSvgSurface::restrictToVersion</a></div>
 <div class="up"><a href="class.cairosvgsurface.html">CairoSvgSurface</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cairosvgsurface.getversions" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">CairoSvgSurface::getVersions</h1>
  <h1 class="refname">cairo_svg_surface_get_versions</h1>
  <p class="verinfo">(PECL cairo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">CairoSvgSurface::getVersions</span> -- <span class="refname">cairo_svg_surface_get_versions</span> &mdash; <span class="dc-title">Used to retrieve a list of supported SVG versions</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-cairosvgsurface.getversions-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格 (method):</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">array</span> <span class="methodname"><strong>CairoSvgSurface::getVersions</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

   <p class="para rdfs-comment">过程化风格:</p>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>cairo_svg_get_versions</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   Returns a numerically indexed array of currently available
   <a href="class.cairosvgversion.html" class="classname">CairoSvgVersion</a> constants. In order to retreive the
   string values for each item, use
   <span class="methodname"><a href="cairosvgsurface.versiontostring.html" class="methodname">CairoSvgSurface::versionToString()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-cairosvgsurface.getversions-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-cairosvgsurface.getversions-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a numerically indexed array of integer values.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-cairosvgsurface.getversions-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2990">
    <p><strong>Example #1 <span class="methodname"><strong>CairoSvgSurface::getVersions()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Grab&nbsp;our&nbsp;list&nbsp;of&nbsp;versions&nbsp;*/<br /></span><span style="color: #0000BB">$versions&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CairoSvgSurface</span><span style="color: #007700">::</span><span style="color: #0000BB">getVersions</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$versions</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;echo&nbsp;the&nbsp;string&nbsp;name&nbsp;of&nbsp;each&nbsp;version&nbsp;*/<br /></span><span style="color: #007700">foreach(</span><span style="color: #0000BB">$versions&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">CairoSvgSurface</span><span style="color: #007700">::</span><span style="color: #0000BB">versionToString</span><span style="color: #007700">(</span><span style="color: #0000BB">$id</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
array(2) {
  [0]=&gt;
  int(0)
  [1]=&gt;
  int(1)
}
SVG 1.1
SVG 1.2
</pre></div>
    </div>
   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2991">
    <p><strong>Example #2 过程化风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Grab&nbsp;our&nbsp;list&nbsp;of&nbsp;versions&nbsp;*/<br /></span><span style="color: #0000BB">$versions&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cairo_svg_surface_get_versions</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$versions</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;echo&nbsp;the&nbsp;string&nbsp;name&nbsp;of&nbsp;each&nbsp;version&nbsp;*/<br /></span><span style="color: #007700">foreach(</span><span style="color: #0000BB">$versions&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">cairo_svg_surface_version_to_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$id</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

     <div class="example-contents"><p>以上例程的输出类似于：</p></div>
     <div class="example-contents screen">
<div class="cdata"><pre>
array(2) {
  [0]=&gt;
  int(0)
  [1]=&gt;
  int(1)
}
SVG 1.1
SVG 1.2
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-cairosvgsurface.getversions-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="cairosvgsurface.versiontostring.html" class="methodname" rel="rdfs-seeAlso">CairoSvgSurface::versionToString()</a> - The versionToString purpose</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairosvgsurface.construct.html">CairoSvgSurface::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairosvgsurface.restricttoversion.html">CairoSvgSurface::restrictToVersion</a></div>
 <div class="up"><a href="class.cairosvgsurface.html">CairoSvgSurface</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
